# encoding=utf-8
from elasticsearch import Elasticsearch

es = Elasticsearch()

res = es.search(index="twitter", body={"query": {"match_all": {}}})
print("Got %d Hits:" % res['hits']['total'])